<?php

/**
 * App
 *
 * @package App
 * @subpackage page
 */
require_once 'App.php';

/**
 * * Admin_Category_Index
 *
 * <pre>カテゴリ管理
 * </pre>
 *
 * @package     App
 * @subpackage  page
 * @author      $Author: moriwaki $
 * @version     $Id: 2008-09-19 moriwaki $
 */
class Admin_Category_Index extends App_Page
{
    /**
     * 認証タイプ
     *
     * @var string
     */
    var $auth = App::AUTH_TOOL;

    /**
     * onInit
     *
     * @param array $args queryString
     * @return void
     * @author moriwaki
     */
    function onInit($args)
    {
        $parent_id = App_Values::getValue('id', $args, 0);
        $params = array();
        $params['mode'] = 'parent_id';
        $params['id'] = $parent_id;
        $params['limit'] = 50;
        $resource = new BEAR_Resource('category');
        $resource->read($params);
        $view['child'] = $resource->getResult();

        $params = array();
        $params['mode'] = 'id';
        $params['id'] = $parent_id;
        $resource = new BEAR_Resource('category');
        $resource->read($params);
        $view['parent'] = $resource->getResult();

        /* セット */
        $this->set('parent_id', $parent_id);
        $this->set('view', $view);
        $this->set('pager', $pager);
    }
}

new BEAR_Main('Admin_Category_Index');
